﻿<%@ Page Title="Frontdesk - Your AutoResponders" Language="C#" MasterPageFile="~/Views/Shared/Frontdesk.Master"
    Inherits="System.Web.Mvc.ViewPage<IEnumerable<Sendz.Domain.AutoResponder>>" %>

<asp:Content ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" runat="server">
    <% if (Model.Count() == 0)
       { %>
    <h2 class="title">
        Don't Respond... AUTO Respond</h2>
    <div class="create">
        <div class="create-link">
            <%: Html.ActionLink("Create AutoResponder", "Create", null, new { title = "Create a new autoresponder" })%></div>
    </div>
    <p class="justify clear">
        The days of manning email responses are gone. Let AutoResponders work for you by
        replying to people who fill out your forms, with custom responses.</p>
    <br />
    <p class="justify">
        Don't worry about trolling for emails and fervently hitting 'reply', every time
        something moves. With Frontdesk, our monkeys do the dirty work for you. For bananas.
        <%: Html.ActionLink("Click here to make one now!", "Create", null, new { title = "Create a new autoresponder" }) %></p>
    <% }
       else
       { %>
    <h2 class="title">
        Your AutoResponders</h2>
    <div class="create">
        <div class="create-link">
            <%: Html.ActionLink("Create AutoResponder", "Create", null, new { title = "Create a new autoresponder" })%></div>
    </div>
    <p class="justify clear">
        Click on any autoresponder to edit it, or click on the 'Actions' link below to see
        all the cool choices at your disposal... We do so much to help you respond to folks,
        they'll be beating down your door in no time.</p>
    <div class="list">
        <% foreach (var autoresponder in Model)
           {%>
        <div class="list-item">
            <div class="list-item-link">
                <%: Html.ActionLink(autoresponder.Name, "Edit", new { id = autoresponder.AutoResponderKey }, new { title = "Edit this autoresponder" }) %>
            </div>
            <div class="menu">
                <span class="actions" title="Click to display the actions you can use for this autoresponder">
                    Actions&nbsp;<img src="<%= Url.Content("~/Content/Frontdesk/dropdown.gif") %>" alt="View options" /></span>
                <ul class="nav">
                    <li>
                        <%: Html.ActionLink("Edit AutoResponder", "Edit", new { id = autoresponder.AutoResponderKey }, new { title = "Edit this autoresponder", @class = "tiny" })%></li>
                    <li>
                        <%: Html.ActionLink("Remove", "Remove", new { id = autoresponder.AutoResponderKey }, new { title = "Remove this autoresponder", onclick = "return confirm('Are you sure? Removing an autoresponder means no forms will send it anymore!');" })%></li>
                </ul>
            </div>
        </div>
        <%
            }%>
    </div>
    <% } %>
</asp:Content>
<asp:Content ContentPlaceHolderID="Sidebar" runat="server">
    <% Html.RenderPartial("videohelp"); %>
</asp:Content>
<asp:Content ContentPlaceHolderID="footer" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $("div.menu span").click(function () {
                $(this).parent().find("ul.nav").slideDown('fast').show(); // Drop down the subnav on click
                $(this).parent().hover(function () { }, function () {
                    $(this).parent().find("ul.nav").slideUp(); // When the mouse hovers out of the subnav, move it back up
                });
            });
        });
    </script>
</asp:Content>
